<template>
     <div>
          <home-header v-if='!isMobile'/>
          <keep-alive>
          <router-view v-if='this.$route.meta.keepAlive' :key="key"/>
          </keep-alive>
          <router-view v-if='!this.$route.meta.keepAlive' :key="key"/>
          <home-footer v-if='!isMobile'/>
     </div>
</template>

<script>
import {HomeFooter,HomeHeader} from '@/components/lj'

export default {
     data(){
          return{

          }
     },
     components:{
          HomeFooter,
          HomeHeader
     },
     computed: {
          isMobile(){//判断终端
               let flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)
               return flag;
          },
          key(){
               return this.$route.path
          }
          
     },
     mounted() {
          this.judge(this);
     },

     methods: {
          judge(that){
               this.$router.replace(`${this.$store.state.terminal}/home`)

          }
         
     },
     
}
</script>